package com.luzhikun.filter3;

import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import java.io.IOException;
// 过滤所有请求
//@WebFilter("/*")
//
//@WebFilter(servletNames="Some-Servlet")
@WebFilter(value = "/*",dispatcherTypes = DispatcherType.FORWARD)
public class SomeFilter implements Filter {


    @Override
    public void init(FilterConfig filterConfig) throws ServletException {

    }

    @Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws ServletException, IOException {
        System.out.println("执行之前");
        chain.doFilter(request, response);
        System.out.println("执行之后");
    }

    @Override
    public void destroy() {

    }
}
